#!/bin/bash
currtDay=$(date +%F)
echo -------------------------$currtDay缓存清理开始---------------------------
startTime=$(date +%F\ %T)
echo $startTime"开始清除缓存"
sync;sync;sync #写入硬盘，防止数据丢失
sleep 10 #延迟10秒
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches
endTime=$(date +%F\ %T)
echo $endTime"清除缓存完成"
echo -------------------------$currtDay缓存清理完成---------------------------
